#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author   : Moty
# @Time     : 2024/10/18 22:39
# @File     : kc16_40.py
# @Project  : CSPT
def parse_40_Trade_Record_Confirm(body):
    # 解析0x35 远程停机命令回复
    data = {
        "交易流水号": f"{body[0:32]}({body[0:32]})",
        "确认结果": f"{confirm_result(body[32:334])}({body[32:34]})",
    }
    formatted_data = ""
    for key, value in data.items():
        formatted_data += f"{key}: {value}\n"
    return formatted_data


def confirm_result(result):
    return "上传成功" if result == "00" else "非法账单" if result == "01" else "未知"


__all__ = ['parse_40_Trade_Record_Confirm']